/**
 * 学习目标：列表渲染-数组渲染， 借助于数组的map方法
 * 列表渲染加key：有id用id，没id用index
 */
import React from 'react';
import ReactDOM from 'react-dom';

const songs = ['温柔', '倔强', '私奔到月球'];

const songsLi = songs.map((item, index) => {
  return <li key={index}>{item}</li>;
});

const divNode = (
  <>
    <ul>{songsLi}</ul>
    <ul>
      {songs.map((item, index) => (
        <li key={index}>{item}</li>
      ))}
    </ul>
  </>
);
ReactDOM.render(divNode, document.getElementById('root'));
